
import 'package:baselib/utils/color_base_util.dart';
import 'package:baselib/utils/px_base_util.dart';
import 'package:flutter/material.dart';

class GradientCardView extends StatelessWidget{
  Widget child;
  double elevation;
  EdgeInsetsGeometry margin;
  EdgeInsetsGeometry padding;
  EdgeInsetsGeometry outPadding;
  BorderRadius borderRadius;
  Gradient gradient;
  double width;
  double height;
  double borderWidth;
  Color backGroundColor;
  AlignmentGeometry alignment;
  GradientCardView({
    @required this.child,
    this.elevation,this.margin,this.padding,this.outPadding,this.borderRadius,
    this.gradient,this.width,this.height,this.backGroundColor,
    this.borderWidth,this.alignment,
  });

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      child: Card(
          color: Colors.transparent,
          elevation: elevation??PxBaseUtil().px_4,
          margin: margin,
          child:Container(
            decoration: BoxDecoration(
              borderRadius: borderRadius??BorderRadius.circular(PxBaseUtil().px_6),
              gradient: gradient??LinearGradient(
                  begin: Alignment.topCenter,
                  end: Alignment.bottomCenter,
                  colors: [
                    ColorBaseUtil().color_AD2CF1,
                    ColorBaseUtil().color_7776FF,
                  ]
              ),
            ),
            width: width,
            padding: outPadding??EdgeInsets.all(borderWidth??PxBaseUtil().px_1),
            height: height,
            alignment: alignment,
            child: Container(
                decoration: BoxDecoration(
                  color: backGroundColor,
                  borderRadius: borderRadius??BorderRadius.circular(PxBaseUtil().px_6),
                ),
                padding: padding,
                // height: PxUtil.instance.px_43,
                child: child??SizedBox(width: 0,)
            ),
          )
      ),
    );
  }

}